package com.hissy.common.design.create.factory;

import java.util.Arrays;

/**
 * Created by zhangyanfei on 2019/4/2.
 *
 * @author zhangyanfei
 * @date 2019/04/02
 */
public class FactoryMain {

    public static void main(String[] args) {
        /**
         * 基础工厂
         */
        PersonA personA = new PersonA();
        PersonB personB = new PersonB();
        Factory factory = new Factory(Arrays.asList(personA, personB));
        factory.createPerson("A");
        factory.doSomething("A");

        /**
         * 工厂方法
         */
        FactoryMethod factoryMethod = new FactoryB();
        factoryMethod.createPerson();
        factoryMethod.doSomething();

        /**
         * 抽象工厂模式 就是细化产品
         */

    }
}
